﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;

namespace Teigha.Core
{
	public class OdGiMaterialRenderItem : OdGiMaterialItem
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdGiMaterialRenderItem(IntPtr cPtr, bool cMemoryOwn) : base(GlobalsPINVOKE.OdGiMaterialRenderItem_SWIGUpcast(cPtr), cMemoryOwn)
		{
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdGiMaterialRenderItem obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdGiMaterialRenderItem()
		{
			this.Dispose();
		}

		public override void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							GlobalsPINVOKE.delete_OdGiMaterialRenderItem(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
			base.Dispose();
		}

		public new static OdGiMaterialRenderItem cast(OdRxObject pObj)
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = GlobalsPINVOKE.OdGiMaterialRenderItem_cast(OdRxObject.getCPtr(pObj));
			OdGiMaterialRenderItem result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdGiMaterialRenderItem)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdGiMaterialRenderItem)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdGiMaterialRenderItem)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new static OdRxClass desc()
		{
			OdRxClass result = (OdRxClass)Teigha.Core.Helpers.odrxCreateObjectInternal(GlobalsPINVOKE.OdGiMaterialRenderItem_desc(), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdRxClass isA()
		{
			OdRxClass result = (OdRxClass)Teigha.Core.Helpers.odrxCreateObjectInternal(GlobalsPINVOKE.OdGiMaterialRenderItem_isA(this.swigCPtr), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdRxObject queryX(OdRxClass protocolClass)
		{
			OdRxObject result = Teigha.Core.Helpers.odrxCreateObjectInternal(GlobalsPINVOKE.OdGiMaterialRenderItem_queryX(this.swigCPtr, OdRxClass.getCPtr(protocolClass)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new static OdGiMaterialRenderItem createObject()
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = GlobalsPINVOKE.OdGiMaterialRenderItem_createObject();
			OdGiMaterialRenderItem result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdGiMaterialRenderItem)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdGiMaterialRenderItem)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdGiMaterialRenderItem)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdGiMaterialTextureEntry specularTexture()
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = GlobalsPINVOKE.OdGiMaterialRenderItem_specularTexture__SWIG_0(this.swigCPtr);
			OdGiMaterialTextureEntry result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdGiMaterialTextureEntry)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdGiMaterialTextureEntry)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdGiMaterialTextureEntry)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdGiMaterialTextureEntry createSpecularTexture()
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = GlobalsPINVOKE.OdGiMaterialRenderItem_createSpecularTexture(this.swigCPtr);
			OdGiMaterialTextureEntry result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdGiMaterialTextureEntry)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdGiMaterialTextureEntry)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdGiMaterialTextureEntry)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void removeSpecularTexture()
		{
			GlobalsPINVOKE.OdGiMaterialRenderItem_removeSpecularTexture(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual bool haveSpecularTexture()
		{
			bool result = GlobalsPINVOKE.OdGiMaterialRenderItem_haveSpecularTexture(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdGiMaterialTextureEntry reflectionTexture()
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = GlobalsPINVOKE.OdGiMaterialRenderItem_reflectionTexture__SWIG_0(this.swigCPtr);
			OdGiMaterialTextureEntry result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdGiMaterialTextureEntry)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdGiMaterialTextureEntry)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdGiMaterialTextureEntry)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdGiMaterialTextureEntry createReflectionTexture()
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = GlobalsPINVOKE.OdGiMaterialRenderItem_createReflectionTexture(this.swigCPtr);
			OdGiMaterialTextureEntry result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdGiMaterialTextureEntry)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdGiMaterialTextureEntry)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdGiMaterialTextureEntry)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void removeReflectionTexture()
		{
			GlobalsPINVOKE.OdGiMaterialRenderItem_removeReflectionTexture(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual bool haveReflectionTexture()
		{
			bool result = GlobalsPINVOKE.OdGiMaterialRenderItem_haveReflectionTexture(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdGiMaterialTextureEntry opacityTexture()
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = GlobalsPINVOKE.OdGiMaterialRenderItem_opacityTexture__SWIG_0(this.swigCPtr);
			OdGiMaterialTextureEntry result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdGiMaterialTextureEntry)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdGiMaterialTextureEntry)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdGiMaterialTextureEntry)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdGiMaterialTextureEntry createOpacityTexture()
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = GlobalsPINVOKE.OdGiMaterialRenderItem_createOpacityTexture(this.swigCPtr);
			OdGiMaterialTextureEntry result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdGiMaterialTextureEntry)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdGiMaterialTextureEntry)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdGiMaterialTextureEntry)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void removeOpacityTexture()
		{
			GlobalsPINVOKE.OdGiMaterialRenderItem_removeOpacityTexture(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual bool haveOpacityTexture()
		{
			bool result = GlobalsPINVOKE.OdGiMaterialRenderItem_haveOpacityTexture(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdGiMaterialTextureEntry bumpTexture()
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = GlobalsPINVOKE.OdGiMaterialRenderItem_bumpTexture__SWIG_0(this.swigCPtr);
			OdGiMaterialTextureEntry result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdGiMaterialTextureEntry)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdGiMaterialTextureEntry)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdGiMaterialTextureEntry)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdGiMaterialTextureEntry createBumpTexture()
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = GlobalsPINVOKE.OdGiMaterialRenderItem_createBumpTexture(this.swigCPtr);
			OdGiMaterialTextureEntry result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdGiMaterialTextureEntry)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdGiMaterialTextureEntry)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdGiMaterialTextureEntry)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void removeBumpTexture()
		{
			GlobalsPINVOKE.OdGiMaterialRenderItem_removeBumpTexture(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual bool haveBumpTexture()
		{
			bool result = GlobalsPINVOKE.OdGiMaterialRenderItem_haveBumpTexture(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdGiMaterialTextureEntry refractionTexture()
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = GlobalsPINVOKE.OdGiMaterialRenderItem_refractionTexture__SWIG_0(this.swigCPtr);
			OdGiMaterialTextureEntry result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdGiMaterialTextureEntry)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdGiMaterialTextureEntry)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdGiMaterialTextureEntry)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdGiMaterialTextureEntry createRefractionTexture()
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = GlobalsPINVOKE.OdGiMaterialRenderItem_createRefractionTexture(this.swigCPtr);
			OdGiMaterialTextureEntry result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdGiMaterialTextureEntry)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdGiMaterialTextureEntry)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdGiMaterialTextureEntry)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void removeRefractionTexture()
		{
			GlobalsPINVOKE.OdGiMaterialRenderItem_removeRefractionTexture(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual bool haveRefractionTexture()
		{
			bool result = GlobalsPINVOKE.OdGiMaterialRenderItem_haveRefractionTexture(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdGiMaterialTextureEntry normalMapTexture()
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = GlobalsPINVOKE.OdGiMaterialRenderItem_normalMapTexture__SWIG_0(this.swigCPtr);
			OdGiMaterialTextureEntry result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdGiMaterialTextureEntry)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdGiMaterialTextureEntry)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdGiMaterialTextureEntry)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdGiMaterialTextureEntry createNormalMapTexture()
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = GlobalsPINVOKE.OdGiMaterialRenderItem_createNormalMapTexture(this.swigCPtr);
			OdGiMaterialTextureEntry result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdGiMaterialTextureEntry)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdGiMaterialTextureEntry)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdGiMaterialTextureEntry)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void removeNormalMapTexture()
		{
			GlobalsPINVOKE.OdGiMaterialRenderItem_removeNormalMapTexture(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual bool haveNormalMapTexture()
		{
			bool result = GlobalsPINVOKE.OdGiMaterialRenderItem_haveNormalMapTexture(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		private object locker = new object();

		private HandleRef swigCPtr;
	}
}
